(forward_to_next_line_start): Stop at end of buffer
authorGerd Moellmann <gerd@gnu.org>
Thu, 18 Jan 2001 12:26:54 +0000 (12:26 +0000)
committerGerd Moellmann <gerd@gnu.org>
Thu, 18 Jan 2001 12:26:54 +0000 (12:26 +0000)
when searching for a newline.

src/xdisp.c

index 6ca639bcbfa8011e8e4e193e00cab8be50fb5a80..2354eaa6209bd77296d84dd214da6fdb320f3d12 100644 (file)
@@ -3511,7 +3511,8 @@ forward_to_next_line_start (it, skipped_p)
        !newline_found_p && n < MAX_NEWLINE_DISTANCE;
        n += STRINGP (it->string) ? 0 : 1)
     {
-      get_next_display_element (it);
+      if (!get_next_display_element (it))
+       break;
       newline_found_p = it->what == IT_CHARACTER && it->c == '\n';
       set_iterator_to_next (it, 0);
     }